/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.jm.financeiro.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.validation.constraints.Size;

/**
 *
 * @author joao
 */
@Entity
@Table(name = "proposta_email", catalog = "salao", schema = "public")
@NamedQueries({
    @NamedQuery(name = "PropostaEmail.findAll", query = "SELECT p FROM PropostaEmail p")})
public class PropostaEmail implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "proposta_email_id_email_seq")
    @SequenceGenerator(name = "proposta_email_id_email_seq", sequenceName = "proposta_email_id_email_seq", initialValue = 1, allocationSize = 1)
    @Basic(optional = false)
    @Column(name = "id_email", nullable = false)
    private Integer idEmail;
    @Size(max = 50)
    @Column(name = "dsc_email", length = 50)
    private String dscEmail;
    //@Pattern(regexp="[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?", message="Invalid email")//if the field contains email address consider using this annotation to enforce field validation
    //@Size(max = 2147483647)
    @Column(name = "email", columnDefinition="text")
    private String email;
    
    public PropostaEmail() {
    }

    public PropostaEmail(Integer idEmail) {
        this.idEmail = idEmail;
    }

    public Integer getIdEmail() {
        return idEmail; 
    }

    public void setIdEmail(Integer idEmail) {
        this.idEmail = idEmail;
    }

    public String getDscEmail() {
        return dscEmail;
    }

    public void setDscEmail(String dscEmail) {
        this.dscEmail = dscEmail;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idEmail != null ? idEmail.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PropostaEmail)) {
            return false;
        }
        PropostaEmail other = (PropostaEmail) object;
        if ((this.idEmail == null && other.idEmail != null) || (this.idEmail != null && !this.idEmail.equals(other.idEmail))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.jm.financeiro.entity.PropostaEmail[ idEmail=" + idEmail + " ]";
    }
    
}
